package com.xyu.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.xyu.common.validated.AddGroup;
import com.xyu.common.validated.ListValue;
import com.xyu.common.validated.UpdateGroup;
import com.xyu.common.validated.UpdateStatusGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;


import javax.validation.constraints.*;

/**
 * 品牌
 *
 * @author wangyufei
 * @email 2070522113@qq.com
 * @date 2021-05-03 21:26:59
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为空",groups = {AddGroup.class, UpdateGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@URL(message = "地址格式错误",groups = {AddGroup.class, UpdateGroup.class})
	@NotEmpty(message = "地址不能为空",groups = {AddGroup.class, UpdateGroup.class})
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
//	@Min(value = 0,message = "错误显示状态只能为0或者1",groups = AddGroup.class)
//	@Max(value = 1, message = "错误显示状态只能为0或者1",groups =AddGroup.class)
	@ListValue(value = {0,1},groups = {AddGroup.class, UpdateGroup.class, UpdateStatusGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotEmpty(message = "检索字母不能为空",groups = {AddGroup.class, UpdateGroup.class})
	@Pattern(regexp = "^[a-zA-Z]$",message = "检索内容只能为字母",groups = {AddGroup.class, UpdateGroup.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(message = "排序值不能为空",groups = {AddGroup.class, UpdateGroup.class})
	@Min(value = 0,message = "排序值大于等于0",groups = {AddGroup.class, UpdateGroup.class})
	private Integer sort;

}
